

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Object &mdash; vt-py  documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../_static/jquery.js"></script>
        <script type="text/javascript" src="../_static/underscore.js"></script>
        <script type="text/javascript" src="../_static/doctools.js"></script>
        <script type="text/javascript" src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Iterator" href="iterator.html" />
    <link rel="prev" title="Feed" href="feed.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> vt-py
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../howtoinstall.html">How to install</a></li>
<li class="toctree-l1"><a class="reference internal" href="../overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart.html">Quickstart</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../apireference.html">API reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="client.html">Client</a></li>
<li class="toctree-l2"><a class="reference internal" href="feed.html">Feed</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Object</a></li>
<li class="toctree-l2"><a class="reference internal" href="iterator.html">Iterator</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.html">Utilities</a></li>
</ul>
</li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">vt-py</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../apireference.html">API reference</a> &raquo;</li>
        
      <li>Object</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/api/object.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="object">
<h1>Object<a class="headerlink" href="#object" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt>
<em class="property">class </em><code class="sig-prename descclassname">vt.</code><code class="sig-name descname">Object</code><span class="sig-paren">(</span><em class="sig-param">obj_type</em>, <em class="sig-param">obj_id=None</em>, <em class="sig-param">obj_attributes=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/object.html#Object"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>This class encapsulates any type of object in the VirusTotal API.</p>
<p>Instances of this class are usually obtained from calls to
<a class="reference internal" href="client.html#vt.Client.get_object" title="vt.Client.get_object"><code class="xref py py-meth docutils literal notranslate"><span class="pre">vt.Client.get_object()</span></code></a>, however, you need to instantiante this class
yourself for creating new objects that will be sent to the backend in a call
to <a class="reference internal" href="client.html#vt.Client.post_object" title="vt.Client.post_object"><code class="xref py py-meth docutils literal notranslate"><span class="pre">vt.Client.post_object()</span></code></a>.</p>
<p>Learn more about objects in the VirusTotal API in:
<a class="reference external" href="https://developers.virustotal.com/v3.0/reference#objects">https://developers.virustotal.com/v3.0/reference#objects</a></p>
<dl class="method">
<dt>
<em class="property">classmethod </em><code class="sig-name descname">from_dict</code><span class="sig-paren">(</span><em class="sig-param">obj_dict</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/object.html#Object.from_dict"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Creates an object from its dictionary representation.</p>
<p>The dictionary representation of a VirusTotal API object has the following
structure:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="o">&lt;</span><span class="nb">object</span> <span class="nb">type</span><span class="o">&gt;</span><span class="p">,</span>
  <span class="s2">&quot;id&quot;</span><span class="p">:</span> <span class="o">&lt;</span><span class="nb">object</span> <span class="nb">id</span><span class="o">&gt;</span><span class="p">,</span>
  <span class="s2">&quot;links&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="s2">&quot;self&quot;</span><span class="p">:</span> <span class="s2">&quot;https://www.virustotal.com/api/v3/&lt;collection name&gt;/&lt;object id&gt;&quot;</span>
  <span class="p">},</span>
  <span class="s2">&quot;attributes&quot;</span><span class="p">:</span> <span class="p">{</span>
    <span class="o">...</span>
  <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>At least <cite>type</cite> and <cite>id</cite> are required to be present in the dictionary, if
not, an exception is raised.</p>
</dd></dl>

<dl class="method">
<dt>
<code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param">attr_name</em>, <em class="sig-param">default=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/object.html#Object.get"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Returns an attribute by name.</p>
<p>If the attribute is not present in the object, it returns None
or the value specified in the “default” argument.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attr_name</strong> (<em>str</em>) – Name of the attribute.</p></li>
<li><p><strong>default</strong> – An optional value that will be returned if the
attribute is not present in the object.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="iterator.html" class="btn btn-neutral float-right" title="Iterator" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="feed.html" class="btn btn-neutral float-left" title="Feed" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, VirusTotal

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>